Passed
Push — main ( 3322df...b61daa )
by Andrii
02:05
created

-this.ts ➔ k   A

Complexity

Conditions 1

Size

Total Lines 7
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
1
import { ClassHash } from "../../src/defs";
2
3
const source = {a: "a", b: undefined}
4
, called = k.call(source)
5
//... @ts-expect-error
6
, key: typeof called[number] = "z"
7
8
export {key}
9
10
function k<K extends string, T extends Record<K, ClassHash>>(
11
  this: T
12
// or `K` - whatever
13
): (keyof T)[] {
14
  //@ts-expect-error
15
  return Object.keys(this)
16
}